#include <cstdio>

using namespace std; 

#define N 1200 

int ra[3][N]; 

void add(int *a, int *b, int *res)
{
    int out; 

	res[0] = 0; 
    for (int i=0; i<N-2; i++) {
        int t = res[i] + a[i] + b[i]; 
        res[i] = t % 10; 
        res[i+1] = t / 10; 
    }
}

void show(int *res)
{
    int out = 0; 
    for (int i=N-1; i>=0; i--) {
        if (out || res[i]!=0 || i==0) {
            printf("%d", res[i]); 
            out = 1; 
        }
    }
    printf("\n"); 
}

int main()
{
	int n, i; 
	int a, b, c, last; 
	scanf("%d", &n); 
	if (n==0) {
		printf("0\n"); 
		return 0; 
	}
	if (n==1 || n==2) {
		printf("1\n"); 
		return 0; 
	}
	a = 0; 
	b = 1; 
	c = 2; 
	ra[0][0] = 1; 
	ra[1][0] = 1; 
	for (i=0; i<n-1; i++) {
		add(ra[a], ra[b], ra[c]); 
		last = c; 
		a = (a==2 ? 0 : a+1); 
		b = (b==2 ? 0 : b+1); 
		c = (c==2 ? 0 : c+1); 
	}
	show(ra[last]); 
	return 0; 
}



